package com.example.demo.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.service.CommonQueryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author kw
 * @program demo1
 * @description
 * @create 2024 - 11 - 29 18:40
 **/
@RestController
@RequestMapping("page")
public class PaginationQueryController {
    @Resource
    private CommonQueryService commonQueryService;
    //        @RequestParam("currentPage") int currentPage,
    //                                   @RequestParam("pageSize") int pageSize

    @PostMapping
    public Page<?> paginationQuery(
            @RequestBody Map<String, Object> condition, @RequestParam("tableName") String tableName) {
        return commonQueryService.queryData(condition,tableName);
    }
}
